package org.oschina.bean;

import java.util.List;

/**
 * 需要分页显示的数据Bean
 * @param <T>
 */
public class Pager<T> extends BaseBean {

	private int pn;
	private int start;
	private int data_sum;
	private int page_count;
	private List<T> data;
	
	public Pager()
	{
		
	}
	
	public Pager(int pn,int data_sum,int page_count,List<T> data)
	{
		this.pn=pn;
		this.data_sum=data_sum;
		this.page_count=page_count;
		this.data=data;
		init();
	}
	
	public void init()
	{
		if(pn<=0)
			pn=1;
		
		start=(pn-1)*page_count;
	}
	
	public int getStart() {
		return start;
	}
	public void setStart(int start) {
		this.start = start;
	}
	public int getPn() {
		return pn;
	}
	public int getData_sum() {
		return data_sum;
	}
	public int getPage_count() {
		return page_count;
	}
	public List<T> getData() {
		return data;
	}
	public void setPn(int pn) {
		this.pn = pn;
	}
	public void setData_sum(int dataSum) {
		data_sum = dataSum;
	}
	public void setPage_count(int pageCount) {
		page_count = pageCount;
	}
	public void setData(List<T> data) {
		this.data = data;
	}
	
}